home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: curses.h <-- getch() ?
- Date: 17 Apr 1996 13:23:27 -0700
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4l3jvvINNieo@keats.ugrad.cs.ubc.ca>
- References: <317543A1.75A8@sun.uniag.sk>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <317543A1.75A8@sun.uniag.sk>,
- Billik Stefan - 2.PEF <billik@sun.uniag.sk> wrote:
- >My problem is that this program don't like our cc && gcc compilers:
- >
- >-------------------------
- >/* It should do this thing:
- > after eighth character it should print it on screen
- > - means without <ENTER>
- >*/
- >
- >#include <stdio.h>
- >#include <string.h>
- >#include <signal.h>
- >#include <curses.h>
- >
- >main()
- >{
- >
- > char ch[9];
- > int i;
- >
- > printf("\n Press 8 characters ... \n");
- >
- > for ( i=0 ; i<=8 ; i++ )
- > ch[i]=getch();
- > printf("\n %s \n", ch[0]);
- >
- >}
-
- The eight character thing ain't gonna happen, because you did not intialize
- curses or tell it to go to raw() or cbreak() mode. As far as I remember, a
- common sequence is:
-
- initscr();
- noecho();
- nonl();
- cbreak();
-
- /* your key input routine */
-
- endwin();
-
-
- >-------------------------
- >During compilation:
- >
- > 18:02 /usr1/users/student/billik/C/$ cc c/getstring.c
- >Undefined first referenced
- > symbol in file
- >wgetch getstring.o
- >stdscr getstring.o
- >ld: fatal: Symbol referencing errors. No output written to a.out
- > 18:02 /usr1/users/student/billik/C/$
-
- >also with gcc.
- >What do you think ?
-
- I think that maybe you need to link in a curses library with -lcurses?
-
- >PS1: SunOS 5.4
-
- You misspelled "Solaris".
- --
- I'm not really a jerk, but I play one on Usenet.
-